home *** CD-ROM | disk | FTP | other *** search
/ Dark Star 1 / Dark_Star_01_1995_-_de_Side_B.d64 / rox 64 (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  8KB  |  233 lines

  1. 1 rem ****rox-64****
  2. 2 rem by jeff minter
  3. 3 rem   16/09/1982
  4. 4 rem **************
  5. 5 rem **llamasoft!**
  6. 6 rem **************
  7. 9 rem ***black screen+ limit memory***
  8. 10 poke53280,0:poke53281,0:poke56,48:clr
  9. 19 rem***sprite bases***
  10. 20 forx=0to6:s(x)=192+x:next x:v=53248
  11. 25 dimsc$(10),sc(10):forx=1to10:sc$(x)="***[156]rox[159]64[158]***":sc(x)=0:next x
  12. 30 forx=s(0)*64tos(6)*64+64:pokex,0:nextx
  13. 35 rem***mothership***
  14. 36 forx=0to50:reada:pokes(1)*64+6+x,a:next x:poke2041,s(1)
  15. 37 data64,20,1,16,170,4,11,255,224,21,85,88,148,0,22,144,0,6,144,0,6,144,0,6
  16. 38 data144,0,6,144,0,6,159,255,246,4,0,16,4,0,16,16,0,4,16,0,4,64,0,1,64,0,1
  17. 39 rem***define sprite #0***
  18. 40 forx=0to7:reada:pokes(0)*64+25+x*3,a:next x
  19. 45 data24,62,124,255,254,126,94,8
  20. 49 rem***sprite #1***
  21. 50 forx=0to56:reada:pokes(6)*64+x,a:next x:poke2046,s(6)
  22. 55 data2,0,0,2,0,0,2,0,0,20,0,0,8,16,0,20,255,0,226,0,128,4,124,64
  23. 56 data5,66,64,4,66,64,2,66,128,1,67,0,2,254,128,4,56,64,8,40,32,16,56,16
  24. 57 data16,40,16,16,56,16,56,40,56
  25. 59 rem***sprite #2***
  26. 60 forx=0to7:reada:pokes(2)*64+25+x*3,a:next x:poke2042,s(2)
  27. 65 data192,224,118,56,24,20,2,0
  28. 67 forx=0to9:readg(x):next x:data160,227,247,248,98,121,111,100,32,32
  29. 69 rem***sprite #3***
  30. 70 forx=0to7:reada:pokes(3)*64+25+x*3,a:next x:poke2043,s(3)
  31. 75 data8,20,28,28,28,28,42,8
  32. 79 rem***sprite #4***
  33. 80 forx=0to7:reada:pokes(4)*64+25+x*3,a:next x:poke2044,s(4)
  34. 85 data3,7,14,60,24,40,64,0
  35. 86 rem***explosion sprite***
  36. 87 forx=0to7:reada:pokes(5)*64+25+x*3,a:next x:poke2045,s(5)
  37. 88 data66,0,4,32,0,34,128,16
  38. 89 rem***sound registers***
  39. 90 vo=54296:wa=54276:at=54277:h=54273:lo=54272:ph=54275:pl=54274:su=54278
  40. 95 pokevo,15:fi=0:a$="":key=197:pokeat+14,32:pokesu+14,255
  41. 98 forx=watowa+14step7:pokex,17:pokex,0:next
  42. 99 rem***print up planet***
  43. 100 gosub20000:print"[147]":forx=1to18:print"";:next
  44. 110 print"[158][185][162][185][175][185][162][185][162][175][162][185][175][185][175][164][164][162][183][183][183][183][183][146][162][185][175][175][185][164][185][175][185][164][185][185][175][164][185][175][185][175]";
  45. 120 print"                                        [146]";
  46. 130 print"lunar eva module #5... landing site scan";
  47. 135 forx=0to30:pp=1104+rnd(1)*600:pokepp,46:pokepp+54272,1:next:da=25:pa=3:nh=0:pt=0
  48. 140 v=53248:co=7:poke2040,s(0):pokev+16,0:pokev+45,3:pokev+21,127:aw=1
  49. 160 gosub5000:df=5:co=8:gosub7500
  50. 170 forx=v+41tov+43:pokex,5:next
  51. 180 pokev+44,1
  52. 190 df=df+2:rox=11:co=co-1
  53. 199 rem***rock initialise***
  54. 200 sx=180:sy=10:pokev,sx:pokev+1,sy:pokev+39,co:hi=0:rox=rox-1:ifrox=0then8000
  55. 210 xo=rnd(1):ifrnd(1)<.5thenxo=-xo
  56. 220 yo=.5:s=df:ifs>20thens=20
  57. 230 pokewa,129:pokeh,200:pokelo,255:pokevo,1:pokev+30,0:pokev+16,0
  58. 299 rem***main motion loop***
  59. 300 sx=sx+xo*(s/3):sy=sy+yo*s
  60. 305 ifsx>255andhi=0thenhi=1:pokev+16,peek(v+16)+1:sx=0
  61. 310 pokev,sx:pokev+1,sy:ifsy>190then1000
  62. 315 iffithengosub6000:iferthen7000
  63. 320 s=s+.3:ifs>20thens=20
  64. 330 pokevo,s/2
  65. 340 if(peek(v+30)and65)=65then10000
  66. 400 p=peek(key):ifp<>64then3000
  67. 410 if fithengosub6000:iferthen7000
  68. 500 goto300
  69. 999 rem***do impact surface***
  70. 1000 t=sx+256*hi:sp=int(t/8)-2:pokev,0:pokev+1,0:pokev+16,0:pokevo,15:pokeh,1
  71. 1010 pokewa+14,0:fi=0:pokery,0:forz=1tornd(1)*4:da=da-1:ifda=0then12000
  72. 1016 gosub7500
  73. 1020 forx=1to10:pokev+17,26:ford=1to10:next:pokev+17,27:pokevo,15-(x/2)
  74. 1030 ford=1to10:nextd,x
  75. 1040 q=1784+sp:p=peek(q):ifp=32thenq=1824+sp:p=peek(q):pokewa,0
  76. 1050 gr=0:forx=0to9:ifp=g(x)thengr=x:x=10
  77. 1060 next x:pokeq,g(gr+1):next z
  78. 1100 goto200
  79. 2999 rem***action for keys***
  80. 3000 iffithen4000
  81. 3005 ifp<>31andp<>28andp<>39then4000
  82. 3010 ifp<>31then3100
  83. 3020 mx=164:my=170:rx=v+4:ry=v+5:xc=-1:n=4:goto3500
  84. 3100 ifp<>28then3200
  85. 3110 mx=164:my=170:rx=v+6:ry=v+7:xc=0:n=8:goto3500
  86. 3200 ifp<>39then4000
  87. 3210 mx=164:my=170:rx=v+8:ry=v+9:xc=1:n=16
  88. 3500 forx=v+4tov+9:pokex,0:next:pokerx,mx:pokery,my:h2=0:n=n+1
  89. 3505 pokewa+14,129:pokeh+14,255-my:pokev+16,hi
  90. 3510 fi=1:goto410
  91. 4000 ifp=10then4500
  92. 4002 ifp=41then4700
  93. 4005 ifp<>60orpa=0then410
  94. 4006 pa=pa-1:pokewa,19:pokevo,15:mx=sx:my=sy
  95. 4010 forx=1to30:poke53281,3:pokeh,29:poke53281,0:pokeh,200:next:gosub7500
  96. 4020 goto7000
  97. 4499 rem***abort mission***
  98. 4500 pokev+21,64:pokewa,129:pokewa+7,0:pokewa+14,0:pokevo,0
  99. 4505 print"[150]***  m i s s i o n     a b o r t e d ***"
  100. 4510 forx=1to15step.3:pokevo,x:yy=yy-.05*x:pokev+13,yy:next x
  101. 4520 pokewa,17:pokewa+7,17:pokeh,32:pokeh+7,33:pokelo,yy:pokelo+7,yy+10
  102. 4530 yy=yy-.75:pokev+13,yy:pokeh,255-yy:pokeh+7,249-yy:ifyy>6then4530
  103. 4540 goto11000
  104. 4699 rem***pause feature***
  105. 4700 print"[144]   *** pause mode - 'p' to restart ***"
  106. 4705 poke53281,1:ifpeek(key)<>64then4700
  107. 4710 ifpeek(key)<>41then4710
  108. 4715 ifpeek(key)<>64then4715
  109. 4720 poke53281,0:print"                                      ":goto410
  110. 4999 rem***lem display***
  111. 5000 pokeat,32:pokesu,255:pokeat+7,32:pokesu+7,255:pokeh,17:pokelo,3
  112. 5001 pokevo,15:pokewa,17:pokewa+7,17
  113. 5002 pokeh+7,16
  114. 5005 pokelo+7,3:pokeph,8:pokepl,8
  115. 5010 yy=3:l=s(6)*64+13:pokev+12,168
  116. 5020 pokel,16:pokel-3,16:forx=1to8:yy=yy+.3:pokev+13,yy:pokelo,yy:pokelo+7,yy
  117. 5025 nextx
  118. 5030 gosub5500:ifyy>175then5060
  119. 5040 pokel,0:pokel-3,0:forx=1to8:yy=yy+.3:pokev+13,yy:pokelo,yy:pokelo+7,yy
  120. 5050 next x:goto5020
  121. 5060 print"       [150]retro thrusters firing...        ";
  122. 5062 pokewa,129:pokewa+7,129:pokeh,7:forx=15to1step-.08:pokevo,x:gosub5500
  123. 5065 yy=yy+.04:pokev+13,yy:next x
  124. 5067 print"     *** planetfall successful ***      ";
  125. 5070 pokewa,17:pokewa+7,0
  126. 5080 pokevo,15:forx=1to5:print"[150]0":pokeh,20:fordl=1to100:next
  127. 5090 print"0":pokeh,0:fordl=1to100:next:next
  128. 5100 print"                     "
  129. 5110 fordl=1to1000:next:print"[144]meteor shower... man all rocket stations";
  130. 5115 pokewa,17:forx=1to9:poke53281,x:forz=0to40step.5
  131. 5120 pokeh,z:next z:next x:poke53281,0
  132. 5200 print"                                        ";:return
  133. 5500 print"[156]altitude  [159]";185-int(yy);"[157] "
  134. 5510 return
  135. 5999 rem***move my rocket***
  136. 6000 mx=mx+xc*8:ifmx>255thenmx=mx-255:pokev+16,peek(v+16)+16
  137. 6010 my=my-8:ifmy<50thenpokery,0:fi=0:pokewa+14,0:return
  138. 6020 pokerx,mx:pokery,my:er=0:pokeh+14,255-my:pokevo,15
  139. 6025 if(peek(v+30)andn)=nthen6200
  140. 6100 return
  141. 6200 er=1:pokewa+14,0:pt=pt+aw*100:goto7500
  142. 6999 rem***do an explosion***
  143. 7000 pokeh,6:pokevo,15:pokev+1,0:pokery,0:nh=nh+1:pokewa,129
  144. 7005 ifhi=1thenpokev+16,32
  145. 7010 forx=15to0step-.3:pokev+10,sx:pokev+11,sy:pokevo,x:pokev+29,32:pokev+23,32
  146. 7020 pokev+10,sx:pokev+11,sy+4:pokevo,x:pokev+29,0:pokev+23,0:next x
  147. 7030 pokev+11,0:fi=0:goto200
  148. 7499 rem***status***
  149. 7500 print"[156]score:";pt;"[157]   [159]panics:";pa;"[157] ";
  150. 7505 print"  [156]high:";sc(1)
  151. 7506 c$="[156]":ifda<10thenc$="[150]"
  152. 7507 x=fre(0):rem avoids garbage collection
  153. 7508 ifda=0thenprint"  ":return
  154. 7510 print"[158]% damage:";c$;:forx=1toda:print"[208]";:next x:print"[146] ";:return
  155. 7999 rem***attack waves***
  156. 8000 print"[144]      rox attack";aw;"[157] completed!!"
  157. 8010 print"        bonus of 100 *";aw
  158. 8020 pt=pt+aw*100:pokevo,15:pokewa,33:forx=0to10:poke53281,rnd(1)*16:fory=0to60
  159. 8030 pokeh,y:nexty:nextx:pokewa,0:poke53281,0
  160. 8040 print"                                       "
  161. 8045 print"                         ":gosub7500
  162. 8050 aw=aw+1:ifaw<7then190
  163. 8060 goto15000
  164. 9999 rem***do in moonbase***
  165. 10000 print"     *** moon base done in !! ***       "
  166. 10010 pokev+21,32:pokewa,129:pokeh,rnd(1)*254:forx=15to0step-.1
  167. 10020 pokev+10,170:pokev+11,180:pokev+23,0:pokev+29,0:pokevo,x
  168. 10030 pokev+10,166:pokev+11,174:pokev+23,32:pokev+29,32:pokevo,0:next x
  169. 10040 pokev+21,0:pokewa,0:bl=1
  170. 10999 rem***endgame scoring***
  171. 11000 print"[147]your score was .. ";pt
  172. 11005 pokewa,0:pokewa+7,0:pokewa+14,0
  173. 11010 print"to this is added a bonus for your";int(nh*100/60)
  174. 11020 print"percent shooting accuracy.":b1=int((nh/60)*5000)
  175. 11030 print"bonus:";b1:pt=pt+b1
  176. 11040 ifbl=1thenbl=0:goto11100
  177. 11050 print"and an additional bonus- for finishing"
  178. 11060 print"with an intact moon base!!"
  179. 11070 print"bonus: 5000 pts.":pt=pt+5000
  180. 11100 print"[158]your final score was thus[159]";pt
  181. 11110 forx=0to20:geta$:next x:z=0:forx=1to10:ifpt>sc(x)thenz=x:x=11
  182. 11120 next x:ifz=0then11500
  183. 11130 print"enter text for score table:";
  184. 11140 inputa$:iflen(a$)>15thena$=left$(a$,15)
  185. 11150 ifz=10then11200
  186. 11160 forx=9tozstep-1:sc(x+1)=sc(x):sc$(x+1)=sc$(x):next x
  187. 11200 sc(z)=pt:sc$(z)=a$:fi=0
  188. 11500 print"[147][158]rox-64 all time best"
  189. 11510 print"[156][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  190. 11520 forx=1to10:print"[159]#";x;tab(10);"";sc(x);tab(23);"[158]";sc$(x)
  191. 11530 next x:x=fre(0)
  192. 11540 print"     press 'space' for a new game"
  193. 11550 p=peek(key):ifp<>60then11550
  194. 11560 goto100
  195. 11999 rem***moonquake!!***
  196. 12000 print"      ***excess seismic activity***":gosub7500
  197. 12010 pokewa,129:pokeh,5:forx=15to0step-.07:pokev+17,26:ford=1to10:next
  198. 12020 pokev+17,27:ford=1to10:next:pokevo,x:next x:goto 10000
  199. 14999 rem***mothership pickup***
  200. 15000 pokev+21,66:pokev+28,2:pokev+37,7:pokev+38,2:rem enable multicolour sprit
  201. 15005 print"mission completed. mothership bonus 5000"
  202. 15010 pokev+23,2:pokev+29,2:pokev+40,4:pokevo,15:pokewa,33:pokewa+7,33
  203. 15015 pt=pt+5000:gosub7500
  204. 15020 pokeh,2:pokeh+7,2:pokelo,1:pokelo+7,6:pokev+3,70
  205. 15030 forx=0to156step.2:pokev+2,x:cl=cl+.3:ifcl>15thencl=0
  206. 15040 pokev+40,cl:pokev+37,15-cl:next x
  207. 15060 pokewa+14,129:forx=15to0step-.1:yy=yy-.05*(15-x):pokev+13,yy:pokev+38,x
  208. 15065 next x:pokewa+14,17
  209. 15070 yy=yy-.75:pokev+13,yy:pokeh+14,200-yy:ifyy>77then15070
  210. 15080 pokev+38,2:pokewa+14,0
  211. 15090 forx=156to226step.2:pokev+2,x
  212. 15095 yy=yy-.2:pokev+13,yy:pokev+12,x+12:cl=cl+1:ifcl>15thencl=0
  213. 15096 pokev+40,cl:pokev+37,15-cl
  214. 15100 pokev+3,227-x:next x:goto11000
  215. 19999 rem***intro titles***
  216. 20000 print"[147][158][209][209][209][209]   [209][209][209]  [209]   [209]     [209][209][159][209][209][156][209] [158][209]   [209]   by"
  217. 20010 print"[158][209]   [209] [209]   [209]  [209] [209]      [159][209]     [209]   [209]"
  218. 20020 print"[158][209][209][209][209]  [209]   [209]   [209]       [156][209][209][158][209][209][209] [209][209][209][209][159][209]  jeff"
  219. 20030 print"[158][209] [209]   [209]   [209]  [209] [209]      [209]   [209]     [156][209]"
  220. 20040 print"[158][209]  [209]   [209][209][209]  [209]   [209]     [209][209][209][209][209]     [158][209] minter"
  221. 20050 print"* an arcade-style game for commodore-64*"
  222. 20060 print"defend your lunar module by firing off"
  223. 20070 print"rockets to intercept incoming meteors."
  224. 20080 print"too many ground impacts result in an"
  225. 20085 print"earthquake! survive 60 meteors for bonus"
  226. 20090 print"and rescue by mothership!"
  227. 20100 print"[158]controls: [159]v,b,n [158]fire rockets. [159]space bar"
  228. 20110 print"[158]activates panic destructor. [159]a[158] to abort!!"
  229. 20120 forx=53248to53248+16:pokex,0:next
  230. 20130 print"press [159]s[158] to start game!";
  231. 20140 ifpeek(197)<>13then20140
  232. 20150 return
  233.